package com.goods.controller.business;

import com.goods.business.service.ProductStockService;
import com.goods.common.model.business.ProductStock;
import com.goods.common.response.ResponseBean;
import com.goods.common.vo.business.InStockVO;
import com.goods.common.vo.business.ProductStockVO;
import com.goods.common.vo.system.PageVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**********************
 *
 *@Author 闫星忠
 *@Time 2021/12/17  16:31
 *
 */
@Api(tags = "业务模块-物资库存相关接口")
@RestController
@RequestMapping("business/product")
public class ProductStockController {

    @Autowired
    private ProductStockService productStockService;


    @ApiOperation(value = "根据name（模糊）和三级分类查询物资库存信息列表")
    @GetMapping("/findProductStocks")
    public ResponseBean<PageVO<ProductStockVO>> findProductStocks(@RequestParam(value = "categorys" ) String categoryKeys,
                                                                  @RequestParam(value = "name")String name) {
        PageVO<ProductStockVO> productStocks = productStockService.findProductStocks(categoryKeys, name);
        return ResponseBean.success(productStocks);
    }
}
